<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>计算机学院课程评价系统 - 学生</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/css/bootstrap.min.css" rel="stylesheet">
    <link href="../css/style.css" rel="stylesheet">
</head>
<body>
    <!-- 导航栏 -->
    <nav class="navbar navbar-expand-lg navbar-light bg-white">
        <div class="container">
            <a class="navbar-brand" href="#">计算机学院课程评价系统</a>
            <div class="d-flex align-items-center">
                <span class="me-3" id="userName"></span>
                <button class="btn btn-outline-danger btn-sm" onclick="utils.logout()">退出</button>
            </div>
        </div>
    </nav>

    <!-- 主要内容 -->
    <div class="container my-4">
        <!-- 选项卡 -->
        <ul class="nav nav-tabs mb-4" id="studentTabs" role="tablist">
            <li class="nav-item" role="presentation">
                <button class="nav-link active" id="courses-tab" data-bs-toggle="tab" data-bs-target="#courses" type="button" role="tab">我的课程</button>
            </li>
            <li class="nav-item" role="presentation">
                <button class="nav-link" id="evaluations-tab" data-bs-toggle="tab" data-bs-target="#evaluations" type="button" role="tab">我的评价</button>
            </li>
        </ul>
        
        <!-- 选项卡内容 -->
        <div class="tab-content" id="studentTabContent">
            <!-- 我的课程 -->
            <div class="tab-pane fade show active" id="courses" role="tabpanel">
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title mb-4">我的课程</h5>
                        <div id="courseMessage" class="alert alert-danger d-none"></div>
                        <div class="table-responsive">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <th>教学班号</th>
                                        <th>课程名称</th>
                                        <th>任课教师</th>
                                        <th>学期</th>
                                        <th>上课时间地点</th>
                                        <th>评价状态</th>
                                        <th>操作</th>
                                    </tr>
                                </thead>
                                <tbody id="courseList"></tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
            
            <!-- 我的评价 -->
            <div class="tab-pane fade" id="evaluations" role="tabpanel">
                <div class="card">
                    <div class="card-body">
                        <h5 class="card-title mb-4">已提交的评价</h5>
                        <div id="evaluationListMessage" class="alert alert-danger d-none"></div>
                        <div class="table-responsive">
                            <table class="table table-hover">
                                <thead>
                                    <tr>
                                        <th>教学班号</th>
                                        <th>课程名称</th>
                                        <th>任课教师</th>
                                        <th>评分</th>
                                        <th>评价内容</th>
                                        <th>评价时间</th>
                                    </tr>
                                </thead>
                                <tbody id="evaluationListTable"></tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 评价模态框 -->
    <div class="modal fade" id="evaluationModal" tabindex="-1">
        <div class="modal-dialog">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title">课程评价</h5>
                    <button type="button" class="btn-close" data-bs-dismiss="modal"></button>
                </div>
                <div class="modal-body">
                    <div id="evaluationMessage" class="alert alert-danger d-none"></div>
                    <form id="evaluationForm">
                        <input type="hidden" id="evaluationClassId">
                        <div class="mb-3">
                            <label for="evaluationCourse" class="form-label">课程名称</label>
                            <input type="text" class="form-control" id="evaluationCourse" readonly>
                        </div>
                        <div class="mb-3">
                            <label for="evaluationTeacher" class="form-label">任课教师</label>
                            <input type="text" class="form-control" id="evaluationTeacher" readonly>
                        </div>
                        <div class="mb-3">
                            <label for="evaluationScore" class="form-label">评分</label>
                            <select class="form-control" id="evaluationScore" required>
                                <option value="5">5分 - 非常满意</option>
                                <option value="4">4分 - 满意</option>
                                <option value="3">3分 - 一般</option>
                                <option value="2">2分 - 不满意</option>
                                <option value="1">1分 - 非常不满意</option>
                            </select>
                        </div>
                        <div class="mb-3">
                            <label for="evaluationComment" class="form-label">评价意见</label>
                            <textarea class="form-control" id="evaluationComment" rows="3" placeholder="请输入您的评价意见..." required></textarea>
                        </div>
                        <button type="submit" class="btn btn-primary">提交评价</button>
                    </form>
                </div>
            </div>
        </div>
    </div>

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.6.0/dist/jquery.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.1.3/dist/js/bootstrap.bundle.min.js"></script>
    <script src="../js/config.js"></script>
    <script src="../js/student.js"></script>
</body>
</html> 